#include "../Header Files/CBaseObject.h"
#include "../../Renderer/Header Files/CRenderer_AL.h"
#include "../../Renderer/Header Files/CAssetManager_AL.h"
#include "../../Renderer/Header Files/CSpriteNode_AL.h"

CBaseObject::CBaseObject()
{
	//m_pRenderNode = new 
	int id = CAssetManager_AL::GetInstance()->CreateTexture("DefaultTexture.png");
	RECT r = { 0, 0, 64, 64 };
	CSpriteNode_AL* temp = new CSpriteNode_AL(CAssetManager_AL::GetInstance()->GetTexture(id), r, D3DXVECTOR3(200, 200, 0), D3DXVECTOR3(1.1f, 1.1f, 1.1f));
	m_pRenderNode = (CRenderNode_AL*)temp;
	m_nObjectType = eSTATICIMAGE_OBJ;
	m_vPosition = { 0.0f, 0.0f, 0.0f };
}

CBaseObject::CBaseObject(CSpriteNode_AL* rndrNd)
{
	m_pRenderNode = (CRenderNode_AL*)rndrNd;
	m_nObjectType = eSTATICIMAGE_OBJ;
	m_vPosition = { 0.0f, 0.0f, 0.0f };
}
CBaseObject::~CBaseObject()
{
	if (m_pRenderNode)
	{
		delete m_pRenderNode;
		m_pRenderNode = NULL;
	}
}
void CBaseObject::Update(float fDT)
{
}
void CBaseObject::DestroyObject()
{
	if (m_pRenderNode)
	{
		delete m_pRenderNode;
		m_pRenderNode = NULL;
	}
}